home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / temgen.lha / Temgen / tg-0.11 / generator.h < prev    next >
C/C++ Source or Header  |  2002-12-18  |  3KB  |  84 lines

  1. #ifndef __generator_h_
  2. #define __generator_h_
  3.  
  4. /*** generator structures manipulation ***/
  5.  
  6. #include "structs.h"
  7.  
  8. struct object;
  9. struct object_part;
  10. struct expression;
  11. struct explist;
  12. struct paramlist;
  13. struct caselist;
  14. struct command;
  15. struct forctl; 
  16. struct fldlist;
  17.  
  18. /* objects */
  19.  
  20. struct object *new_object( struct object*, struct object_part* ); 
  21.  
  22. struct object_part *new_part( const char *name );
  23. struct object_part *new_fun( struct object_part*, struct explist* );
  24. struct object_part *new_tab( struct object_part*, struct expression* );
  25. struct object_part *new_exppart( struct expression* );
  26.  
  27. /* expressions */
  28.  
  29. struct explist *new_explist( struct explist*, struct expression* );
  30. struct fldlist *new_fldlist( struct fldlist*, const char*, struct expression* );
  31.  
  32. struct expression *new_num( int );
  33. struct expression *new_inc( struct expression*, int, int );
  34. struct expression *new_float( float );
  35. struct expression *new_string( const char* );
  36. struct expression *new_objexp( struct object* );
  37. struct expression *new_exp( struct expression*, char op, struct expression* ); 
  38. struct expression *new_array( struct explist* );
  39. struct expression *new_record( struct fldlist* );
  40.  
  41. /* commands */
  42. struct command *new_if( struct expression*, int else_line, int end_line );
  43. struct command *new_goto( int line );
  44. struct command *new_embed( struct expression* ); 
  45. struct command *new_emit( struct expression* ); 
  46. struct command *new_exit( struct expression* ); 
  47. struct command *new_output( struct expression* ); 
  48. struct command *new_local( const char *name ); 
  49. struct command *new_use( const char *name ); 
  50. struct command *new_function( const char *name, struct paramlist*, int end_line );
  51. struct paramlist *new_parlist( struct paramlist*, const char *param );
  52.  
  53. struct command *new_switch( struct expression*, struct caselist*, 
  54.         int start_line, int end_line );
  55. struct caselist *new_caselist( struct caselist*, struct expression*, int line );
  56. struct command *new_for( struct forctl*, int start_line, int end_line );
  57. struct forctl *new_forctl( struct expression*, 
  58.         struct expression*, struct expression* );
  59. struct forctl *new_lforctl( struct expression*, struct expression* );
  60. struct command *new_return( struct expression* );
  61. struct command *new_break( int );
  62. struct command *new_push( void );
  63. struct command *new_pop( void );
  64. struct command *new_cmdexp( struct expression* );
  65. struct command *build_lcmd_c( struct command*, int start, int end );
  66. struct command *build_lcmd_e( struct command*, struct expression*, 
  67.                 int start, int end );
  68.  
  69. void add_cmd( struct lintab*, int line, struct command *c );
  70. void close_line( int line, int end );
  71.  
  72.  
  73. /* interpreter */
  74. int run_cmd( int index, struct command*, struct sourcefile* );
  75.  
  76. /* debugging and testing functions */
  77. void dump_expression( char *buf, int size, struct expression* );
  78. void dump_cmd( int line, struct command* );
  79.  
  80. void warning( const char *msg );
  81. void fatal( const char *msg );
  82.  
  83. #endif
  84.